﻿--|--------------------------------------------------------------------------------
--| [InsertEntity] - Insert Procedure Script for Entity
--|--------------------------------------------------------------------------------
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id (N'[dbo].[InsertEntity]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1) 
  DROP PROCEDURE [dbo].[InsertEntity]
GO

CREATE PROCEDURE [dbo].[InsertEntity]
(
	@Name nvarchar(50),
	@Description nvarchar(250) = NULL,
	@TeamID int,
	@Photo image = NULL,
	@EntityTypeID int
)
AS
	SET NOCOUNT ON

	INSERT INTO [Entity]
	(
		[Name],
		[Description],
		[TeamID],
		[Photo],
		[EntityTypeID]
	)
	VALUES
	(
		@Name,
		@Description,
		@TeamID,
		@Photo,
		@EntityTypeID
	)

	RETURN @@Error
GO
 